<% layout('/layouts/default.html', {title: 'dc_sup_exam_org_select管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">

		</div>
		<#form:form id="inputForm" model="${dcSupExamOrgSelect}" action="${ctx}/orgselect/dcSupExamOrgSelect/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<div class="row">

					<#form:hidden path="isNewRecord"/>

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('机构名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="orgCode" title="${text('机构选择')}"
									path="orgCode" labelPath="orgName"
								url="${ctx}/sys/office/treeUnitData"
								class="hideUnit" isReturnValue="false" allowClear="true" canSelectRoot="true" canSelectParent="true" class="required"
								returnFullName="false"
								allowClear="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('序号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="orgSort" class="form-control digits required" max="99999"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('类型1')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<% var items = [{label:'请选择',value:''},{label:'区县',value:'1'},{label:'市直',value:'2'}]; %>
								<#form:select path="orgType" items="${items}" itemLabel="label" itemValue="value"  class="form-control width-120 required" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('类型2')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="groupUnit" dictType="dc_exam_unit_classification" blankOption="true"  data-placeholder="请选择" class="form-control required"  />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('机构别名')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="aliasName" maxlength="100" class="form-control" />
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">

							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;

						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>

	function treeselectCallback(id, act, index, layero, nodes){

			// log(nodes[0].title);  // 选择的节点数据
		if(!$("#aliasName").val()){
			$("#aliasName").val(nodes[0].title)
		}

	}
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>